From: Álvaro Fernández Rojas Date: Mon, 10 Nov 2025 12:43:48 +0000 (+0100) Subject: src: replace #pragma once with defines X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=2b26df1293c1209596fdb2327ca3393bc0d5fdd4;p=project%2Fodhcpd.git src: replace #pragma once with defines Replace #pragma once with defines since it's not standard. Signed-off-by: Álvaro Fernández Rojas --- diff --git a/src/dhcpv4.h b/src/dhcpv4.h index 9b28059..6599acf 100644 --- a/src/dhcpv4.h +++ b/src/dhcpv4.h @@ -12,7 +12,9 @@ * GNU General Public License version 2 for more details. * */ -#pragma once + +#ifndef _DHCPV4_H_ +#define _DHCPV4_H_ #define DHCPV4_CLIENT_PORT 68 #define DHCPV4_SERVER_PORT 67 @@ -178,3 +180,5 @@ struct dhcpv4_dnr { &opt[1] <= (struct dhcpv4_option*)(end) && \ &opt->data[opt->len] <= (end); \ opt = (struct dhcpv4_option*)&opt->data[opt->len]) + +#endif /* _DHCPV4_H_ */ diff --git a/src/dhcpv6-pxe.h b/src/dhcpv6-pxe.h index 0e3c227..eedba0e 100644 --- a/src/dhcpv6-pxe.h +++ b/src/dhcpv6-pxe.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef _DHCPV6_PXE_H_ +#define _DHCPV6_PXE_H_ #include #include @@ -11,3 +12,5 @@ const struct ipv6_pxe_entry* ipv6_pxe_of_arch(uint16_t arch); void ipv6_pxe_serve_boot_url(uint16_t arch, struct iovec* iov); void ipv6_pxe_dump(void); void ipv6_pxe_clear(void); + +#endif /* _DHCPV6_PXE_H_ */ diff --git a/src/dhcpv6.h b/src/dhcpv6.h index 5c3986c..de0362f 100644 --- a/src/dhcpv6.h +++ b/src/dhcpv6.h @@ -11,7 +11,9 @@ * GNU General Public License version 2 for more details. * */ -#pragma once + +#ifndef _DHCPV6_H_ +#define _DHCPV6_H_ #include "odhcpd.h" @@ -168,3 +170,5 @@ struct dhcpv6_cer_id { ((otype) = _o[0] << 8 | _o[1]) && ((odata) = (void*)&_o[4]) &&\ ((olen) = _o[2] << 8 | _o[3]) + (odata) <= (end); \ _o += 4 + (_o[2] << 8 | _o[3])) + +#endif /* _DHCPV6_H_ */ diff --git a/src/odhcpd.h b/src/odhcpd.h index 6cae39d..e8cb6dd 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -12,7 +12,9 @@ * */ -#pragma once +#ifndef _ODHCPD_H_ +#define _ODHCPD_H_ + #include #include #include @@ -626,3 +628,5 @@ int ndp_setup_interface(struct interface *iface, bool enable); void reload_services(struct interface *iface); void odhcpd_reload(void); + +#endif /* _ODHCPD_H_ */ diff --git a/src/router.h b/src/router.h index 9b028d1..5502a0d 100644 --- a/src/router.h +++ b/src/router.h @@ -12,7 +12,9 @@ * */ -#pragma once +#ifndef _ROUTER_H_ +#define _ROUTER_H_ + #include #include #include @@ -98,3 +100,5 @@ struct icmpv6_opt { * use this until it is defined in netinet/icmp6.h */ #define ND_OPT_PI_FLAG_PD_PREFERRED 0x10 + +#endif /* _ROUTER_H_ */